<!--
 * @Author: gy
 * @Date: 2019-12-24 15:13:01
 * @LastEditors  : wl
 * @LastEditTime : 2020-06-17 17:39:10
 -->
<!--  -->
<template>
  <div class="layout-content">
    <el-form ref="form" :model="form" :rules="rules" label-width="90px">
      <el-form-item label="用户名称" prop="user_name">
        <el-input v-model="form['user_name']" placeholder="请输入用户名称" disabled />
      </el-form-item>
      <el-form-item label="旧密码" prop="oldPassword">
        <el-input v-model="form['oldPassword']" placeholder="请输入密码"/>
      </el-form-item>
      <el-form-item label="新密码" prop="newPassword">
        <el-input v-model="form['newPassword']" placeholder="请输入密码" />
      </el-form-item>
      <el-form-item label="再次确认" prop="confirmPassword">
        <el-input v-model="form['confirmPassword']" placeholder="请再次输入密码" />
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: 'ResetUser',
  props: {},
  data() {
    return {
      form: {
        user_name: '',
        oldPassword: '',
        newPassword: '',
        confirmPassword: ''
      },
      rules: {
        user_name: [
          {
            required: true,
            message: '请输用户昵称',
            trigger: 'blur'
          }
        ],
        oldPassword: [
          {
            required: true,
            message: '请输入原密码',
            trigger: 'blur'
          }
        ],
        newPassword: [
          {
            required: true,
            message: '请输入新密码',
            trigger: 'blur'
          }
        ],
        confirmPassword: [
          {
            required: true,
            message: '请再次输入新密码',
            trigger: 'blur'
          }
        ]
      },
      checkRepeatParam: {
        url: '/system/api/User/checkLoginNameUnique',
        param: 'login_name',
        methods: 'get'
      },
    }
  },

  methods: {
  },
  watch: {
    // 'form.password': {
    //   handler(val) {
    //     if(val && this.form['oldPassword']) {
    //       if(val !== this.form['oldPassword']) {
    //         this.$message.error
    //       }
    //     }
    //     // console.log(val, 'password')
    //   },
    //   immediate: true
    // }
  },
}
</script>
<style lang="scss" scoped>
</style>
